package gui;

import java.awt.Color;

import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.event.ActionListener;

import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;

/**
 * 
 * @author chkr1_000 Initiates Login class
 * 
 */
public class Login extends JPanel {
	private JLabel lbllogin;
	private JLabel lblCprNummer;
	private JLabel lblPassword;
	private JTextField txtBrugerID;
	private JLabel lblCopyright;
	private JButton btnLogin;
	private JLabel lblThebank;
	private JTextField txtPassword;
	Screen screen;
	private JLabel lblFailedlogin;

	/**
	 * Creates the layout for Login
	 */
	public Login() {
		setLayout(null);
		setSize(Screen.SIZE);
		setBackground(Screen.COLOR);

		lbllogin = new JLabel(".:Login:.");
		lbllogin.setForeground(Color.WHITE);
		lbllogin.setFont(new Font("Helvetica", Font.BOLD, 20));
		lbllogin.setBounds(302, 50, 80, 21);
		add(lbllogin);

		lblCprNummer = new JLabel("Cpr-nummer:");
		lblCprNummer.setForeground(Color.WHITE);
		lblCprNummer.setBounds(206, 225, 86, 16);
		add(lblCprNummer);

		lblPassword = new JLabel("Password:");
		lblPassword.setForeground(Color.WHITE);
		lblPassword.setBounds(229, 302, 63, 16);
		add(lblPassword);

		txtBrugerID = new JTextField();
		txtBrugerID.setBounds(304, 296, 134, 28);
		add(txtBrugerID);
		txtBrugerID.setColumns(10);

		txtPassword = new JPasswordField();
		txtPassword.setBounds(304, 296, 134, 28);
		add(txtPassword);
		txtPassword.setColumns(10);

		lblCopyright = new JLabel("\u00A9 Copyright - All rights reserved");
		lblCopyright.setForeground(Color.WHITE);
		lblCopyright.setFont(new Font("Lucida Grande", Font.PLAIN, 13));
		lblCopyright.setBounds(414, 600, 208, 16);
		add(lblCopyright);

		Icon lock = new ImageIcon(getClass().getResource("54-lock@2x.png"));

		btnLogin = new JButton(" Login", lock);
		btnLogin.setFont(new Font("Lucida Grande", Font.PLAIN, 16));
		btnLogin.setBounds(287, 374, 115, 60);
		add(btnLogin);

		Icon logo = new ImageIcon(getClass().getResource("190-bank.png"));

		lblThebank = new JLabel("TheBank", logo, SwingConstants.LEFT);
		lblThebank.setForeground(Color.WHITE);
		lblThebank.setFont(new Font("Helvetica", Font.BOLD, 16));
		lblThebank.setBounds(30, 25, 99, 22);
		add(lblThebank);

		lblFailedlogin = new JLabel("You typed the wrong CPR or Password");
		lblFailedlogin.setIcon(new ImageIcon(Login.class
				.getResource("/gui/Error!.png")));
		lblFailedlogin.setForeground(Color.RED);
		lblFailedlogin.setFont(new Font("SansSerif", Font.BOLD | Font.ITALIC,
				16));
		lblFailedlogin.setBounds(169, 144, 354, 60);
		lblFailedlogin.setVisible(false);
		add(lblFailedlogin);

	}

	/**
	 * 
	 * @param addActionListener
	 *            (1)
	 */
	public void addActionListener(ActionListener l) {
		btnLogin.addActionListener(l);
	}

	/**
	 * 
	 * @return lblFailedlogin
	 */
	public JLabel getLblFailedlogin() {
		return lblFailedlogin;
	}

	/**
	 * 
	 * @param lblFailedlogin
	 */
	public void setLblFailedlogin(JLabel lblFailedlogin) {
		this.lblFailedlogin = lblFailedlogin;
	}

	/**
	 * 
	 * @return lbllogin
	 */
	public JLabel getLbllogin() {
		return lbllogin;
	}

	/**
	 * 
	 * @param lbllogin
	 */
	public void setLbllogin(JLabel lbllogin) {
		this.lbllogin = lbllogin;
	}

	/**
	 * 
	 * @return lblCprNummer
	 */
	public JLabel getLblCprNummer() {
		return lblCprNummer;
	}

	/**
	 * 
	 * @param lblCprNummer
	 */
	public void setLblCprNummer(JLabel lblCprNummer) {
		this.lblCprNummer = lblCprNummer;
	}

	/**
	 * 
	 * @return lblPassword
	 */
	public JLabel getLblPassword() {
		return lblPassword;
	}

	/**
	 * 
	 * @param lblPassword
	 */
	public void setLblPassword(JLabel lblPassword) {
		this.lblPassword = lblPassword;
	}

	/**
	 * 
	 * @return txtBrugerID
	 */
	public JTextField getTxtBrugerID() {
		return txtBrugerID;
	}

	/**
	 * 
	 * @param txtBrugerID
	 */
	public void setTxtBrugerID(JTextField txtBrugerID) {
		this.txtBrugerID = txtBrugerID;
	}

	/**
	 * 
	 * @return lblCopyright
	 */
	public JLabel getLblCopyright() {
		return lblCopyright;
	}

	/**
	 * 
	 * @param lblCopyright
	 */
	public void setLblCopyright(JLabel lblCopyright) {
		this.lblCopyright = lblCopyright;
	}

	/**
	 * 
	 * @return txtPassword
	 */
	public JTextField getTxtPassword() {
		return txtPassword;
	}

	/**
	 * 
	 * @param txtPassword
	 */
	public void setPasswordField(JTextField txtPassword) {
		this.txtPassword = txtPassword;
	}

	/**
	 * 
	 * @return btnLogin
	 */
	public JButton getBtnLogin() {
		return btnLogin;
	}

	/**
	 * 
	 * @param btnLogin
	 */
	public void setBtnLogin(JButton btnLogin) {
		this.btnLogin = btnLogin;
	}

	/**
	 * 
	 * @return lblTheBank
	 */
	public JLabel getLblThebank() {
		return lblThebank;
	}

	/**
	 * 
	 * @param lblThebank
	 */
	public void setLblThebank(JLabel lblThebank) {
		this.lblThebank = lblThebank;
	}

	/**
	 * 
	 * @return screen
	 */
	public Screen getScreen() {
		return screen;
	}

	/**
	 * 
	 * @param screen
	 */
	public void setScreen(Screen screen) {
		this.screen = screen;
	}
}
